package com.iflytek.controller;

import com.iflytek.feignclients.ProductClient;
import com.iflytek.product.entity.Product;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author yfliu9
 * @version 1.0
 * @description: TODO
 * @date 2021/8/28 15:48
 */
@RestController
@Slf4j
public class CateGroyController {

    @Autowired
    private ProductClient productClient;

    @GetMapping("/categroy")
    public String categroy() {
        log.info("categroy service....");
        String product = productClient.product();
        log.info("获取product服务端结果：{}", product);

/*        String testResult = productClient.test("柳永峰", 1);
        log.info("获取零散参数(按照名称)传递结果：{}", testResult);

        String path = productClient.testPath("path", 3);
        log.info("获取零散参数(按照路径)传递结果：{}", path);

        Product product1 = new Product(1, "超短裙", 23.33, new Date());
        String objResult = productClient.testObject(product1);
        log.info("获取对象参数传递结果：{}", objResult);

        String[] ids = {"1", "2", "3"};
        String arrayResult = productClient.testArray(ids);
        log.info("获取数组参数传递结果：{}", arrayResult);

        List<String> list = Arrays.asList(ids);
        String colResult = productClient.testCollection(list);
        log.info("获取集合参数传递结果：{}", colResult);*/
        return "categroy ok";
    }
}
